package com.lzc;

import com.lzc.websocket.WebSocketListener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;


@SpringBootApplication
@PropertySource(value = "classpath:wxurl.properties")
public class RunStart {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(RunStart.class, args);

        // 容器给websocket
        WebSocketListener.setApplicationContext(context);
    }

    // WebSocket监听端口Bean后置处理器
    //@Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}
